package com.taotao.delayjob.core.model;

import com.alibaba.fastjson2.JSON;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 任务重试实例
 *
 * @author Fan Beibei
 * @date 2024-07-17 10:22:25
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class RetryInstDto implements Serializable {

    @NotBlank(message = "业务类型编码不能为空")
    @ApiModelProperty(value = "业务类型编码")
    private String busiCode;
    @NotBlank(message = "业务编号不能为空")
    @ApiModelProperty(value = "业务编号")
    private String busiNo;
    @ApiModelProperty(value="业务参数")
    private String param;
    @NotNull(message = "最大重试次数不能为空")
    @ApiModelProperty(value = "最大重试次数")
    private Integer maxNum = 3;
    @NotNull(message = "首次重试延迟时间不能为空")
    @ApiModelProperty(value = "首次重试延迟时间（秒）")
    private Integer firstDelay = 300;
    @NotNull(message = "重试间隔时间不能为空")
    @ApiModelProperty(value = "重试间隔时间（秒）")
    private Integer intervalSeconds = 300;
    @ApiModelProperty(value = "备注")
    private String note;


    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

}